
<div class="modal-yaml">
  {{input-yaml
    title=(t "modalImport.title")
    name="import.yaml"
    canChangeName=false
    value=yaml
    autoResize=true
    resizeFooter=320
    showDownload=false
  }}
</div>

{{#unless modalOpts.clusterOnly}}

<div class="mt-20 row">
  <div class="col span-6">
    <label class="acc-label">
      {{t "modalImport.mode.label"}}
    </label>
    <div>
      <label>
        {{radio-button selection=mode value="cluster"}} {{t "modalImport.mode.cluster"}}
      </label>
    </div>
    <div>
      <label>
        {{radio-button selection=mode value="project"}} {{t "modalImport.mode.project"}}
      </label>
    </div>
    <div>
      <label>
        {{radio-button selection=mode value="namespace"}} {{t "modalImport.mode.namespace"}}
      </label>
    </div>
  </div>
  <div class="col span-6">
    {{#unless (eq mode "cluster")}}
      {{form-namespace
        reuseLabel=(if (eq mode "project") "formNamespace.label.default" "formNamespace.label.reuse")
        namespace=namespace
        errors=namespaceErrors
        registerHook=(action "registerHook")
      }}
    {{/unless}}
  </div>
</div>

{{#if (eq mode "cluster") }}
  <p class="help-block">{{t "modalImport.detail.cluster1" htmlSafe=true}}</p>
  <p class="help-block">{{t "modalImport.detail.cluster2" htmlSafe=true}}</p>
  <p class="help-block">{{t "modalImport.detail.cluster3" htmlSafe=true}}</p>
{{else if (eq mode "project") }}
  <p class="help-block">{{t "modalImport.detail.project1" htmlSafe=true}}</p>
  <p class="help-block">{{t "modalImport.detail.project2" htmlSafe=true}}</p>
{{else}}
  <p class="help-block">{{t "modalImport.detail.namespace1" htmlSafe=true}}</p>
  <p class="help-block">{{t "modalImport.detail.namespace2" htmlSafe=true}}</p>
{{/if}}

{{/unless}}

{{top-errors errors=errors}}
{{top-errors errors=namespaceErrors}}
{{save-cancel
  save=(action "save")
  cancel=(action "cancel")
  editing=editing
  createLabel="generic.import"
}}
